

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Cliente</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Cliente List</g:link></span>
        </div>
        <div class="body">
            <h1>Create Cliente</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${cliente}">
            <div class="errors">
                <g:renderErrors bean="${cliente}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="categoria">Categoria:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'categoria','errors')}">
                                    <g:select optionKey="id" from="${CategoriaDeCliente.list()}" name="categoria.id" value="${cliente?.categoria?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataCadastro">Data Cadastro:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'dataCadastro','errors')}">
                                    <g:datePicker name="dataCadastro" value="${cliente?.dataCadastro}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataNascimento">Data Nascimento:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'dataNascimento','errors')}">
                                    <g:datePicker name="dataNascimento" value="${cliente?.dataNascimento}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="email">Email:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'email','errors')}">
                                    <input type="text" id="email" name="email" value="${fieldValue(bean:cliente,field:'email')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="fone">Fone:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'fone','errors')}">
                                    <input type="text" id="fone" name="fone" value="${fieldValue(bean:cliente,field:'fone')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome">Nome:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'nome','errors')}">
                                    <input type="text" id="nome" name="nome" value="${fieldValue(bean:cliente,field:'nome')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="referencias">Referencias:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'referencias','errors')}">
                                    <input type="text" id="referencias" name="referencias" value="${fieldValue(bean:cliente,field:'referencias')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="sexo">Sexo:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'sexo','errors')}">
                                    <input type="text" id="sexo" name="sexo" value="${fieldValue(bean:cliente,field:'sexo')}"/>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
